﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IBLL;
using Model;
using DALFAC;

namespace BLL
{
    public class UserBLL:IUserBLL
    {
        //登陆
        public bool Login(string username, string password)
        {
            bool validator = false;
            DAL.UserLgoinDAL userLogin = (DAL.UserLgoinDAL)DALFAC.DataAccess.CreateUserLgoin();
            if (userLogin.userNameExists(username)) {
                validator = true;
            }   

            return validator;

        }

        //注册
        public bool register(Model.UserInfo newUser)
        {
            bool register = false;
            DAL.UserInfoDAL user = (DAL.UserInfoDAL)DALFAC.DataAccess.CreateUserInfo();
            register = user.Add(newUser);
            return register;
        }

        //获取推荐照片
        public bool modifyUser(Model.UserInfo newUser)
        {
            bool modifier = false;
            DAL.UserInfoDAL user = (DAL.UserInfoDAL)DALFAC.DataAccess.CreateUserInfo();
            modifier = user.Update(newUser);
            return modifier;
        }
    }
}
